﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace DataAccessLayer
{
    public enum RecordState
    {
        NONE_STATE,
        ADD_STATE,
        EDIT_STATE,
        DEL_STATE,
    }

    public enum ThietBiBHState
    {
        EXISTS_STATE,
        NOT_EXIST_STATE,
    }

    public partial class Phien_ThietBiBH : INotifyPropertyChanged
    {
        public DateTime _recordCreatedTime;
        public bool _ableDeleted;
        public string _maThietBiBaoHanh;
        public string _tenThietBiBaoHanh;
        public int _nCCId;
        public string _serial;
        public int _nSXId;
        public string _model;
        public string _tenLoaiDichVu;
        public DateTime _thoiHanBaoHanh;
        public RecordState _modifyState = RecordState.NONE_STATE;
        public event PropertyChangedEventHandler PropertyChanged;

        public DateTime RecordCreatedTime
        {
            get { return _recordCreatedTime; }
            set
            {
                _recordCreatedTime = value;
                if (_recordCreatedTime != value)
                {
                    this.NotifyPropertyChanged("RecordCreatedTime");
                }
            }
        }
        public bool AbleDeleted
        {
            get { return _ableDeleted; }
            set
            {
                _ableDeleted = value;
                if (_ableDeleted != value)
                {
                    this.NotifyPropertyChanged("AbleDeleted");
                }
            }
        }
        public string MaThietBiBaoHanh
        {
            get { return _maThietBiBaoHanh; }
            set
            {
                _maThietBiBaoHanh = value;
                if (_maThietBiBaoHanh != value)
                {
                    this.NotifyPropertyChanged("MaThietBiBaoHanh");
                }
            }
        }
        public string TenThietBiBaoHanh
        {
            get { return _tenThietBiBaoHanh; }
            set
            {
                _tenThietBiBaoHanh = value;
                if (_tenThietBiBaoHanh != value)
                {
                    this.NotifyPropertyChanged("TenThietBiBaoHanh");
                }
            }
        }
        public int NCCId
        {
            get { return _nCCId; }
            set
            {
                _nCCId = value;
                if (_nCCId != value)
                {
                    this.NotifyPropertyChanged("NCCId");
                }
            }
        }
        public string Serial
        {
            get { return _serial; }
            set
            {
                _serial = value;
                if (_serial != value)
                {
                    this.NotifyPropertyChanged("Serial");
                }
            }
        }
        public int NSXId
        {
            get { return _nSXId; }
            set
            {
                _nSXId = value;
                if (_nSXId != value)
                {
                    this.NotifyPropertyChanged("NSXId");
                }
            }
        }
        public string Model
        {
            get { return _model; }
            set
            {
                _model = value;
                if (_model != value)
                {
                    this.NotifyPropertyChanged("Model");
                }
            }
        }
        public string TenLoaiDichVu
        {
            get { return _tenLoaiDichVu; }
            set
            {
                _tenLoaiDichVu = value;
                if (_tenLoaiDichVu != value)
                {
                    this.NotifyPropertyChanged("TenLoaiDichVu");
                }
            }
        }
        public RecordState ModifyState
        {
            get { return _modifyState; }
            set
            {
                _modifyState = value;
                if (_modifyState != value)
                {
                    this.NotifyPropertyChanged("ModifyState");
                }
            }
        }
        public DateTime ThoiHanBaoHanh
        {
            get { return _thoiHanBaoHanh; }
            set
            {
                _thoiHanBaoHanh = value;
                if (_thoiHanBaoHanh != value)
                {
                    this.NotifyPropertyChanged("ThoiHanBaoHanh");
                }
            }
        }
        //public ThietBiBHState ThietBiState = ThietBiBHState.NOT_EXIST_STATE;
        private void NotifyPropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }

    }

    public partial class ThietBiBaoHanh
    {
        public string _tenThietBiAndMa;

        public string TenThietBiAndMa
        {
            get 
            {
                return (this.Ten + " - " + this.Ma); 
            }
        }

    }

    public partial class NhanVien
    {
        public string _maTenNhanVien;

        public string MaTenNhanVien
        {
            get
            {
                return (this.Ma + " - " + this.Ten);
            }
        }

    }

    public partial class NhaCungCap
    {
        public string _maTenNhaCungCap;

        public string MaTenNhaCungCap
        {
            get
            {
                return (this.Ma + " - " + this.Ten);
            }
        }

    }

}
